<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<style type="text/css">
.sc{
	background: green;
}
</style>
<body>
<div>
	<p></p>
	<p></p>
	<p></p>
</div>


<script>
	function $(s){
		return document.querySelectorAll(s);
	}
var p = $("p"),
	div = $("div")[0],
	c = getComputedStyle(p[2]).height;
	console.log(c)
	var arr1 = [15,14,12,11];
	console.log(arr1.reduce(function(a,b){ return a+b},100));
var arr = 
	[{title:"A",cons:[
		{title:"A-1",cons:["A-1-1","A-1-2"]},
		{title:"A-2",cons:["A-2-1","A-2-2"]},
	]},
	{title:"B",cons:[
		{title:"B-1",cons:["B-1-1","B-1-2"]},
		{title:"B-2",cons:["B-2-1","B-2-2"]}
	]}
	];

	for (var i = 0; i < arr.length; i++) {
		p[0].innerHTML += arr[i].title+"<br>";
		for (var j = 0; j < arr[i].cons.length; j++) {
			p[1].innerHTML+=arr[i].cons[j].title+"<br>";
			for (var k = 0; k < arr[i].cons[j].cons.length; k++) {
				 p[2].innerHTML+=arr[i].cons[j].cons[k]+"<br>";
			}
		}
	}
	
	

	var a =p[0].cloneNode(true);
	console.log(a);
/*
怎样获取当前点击？？
事件委托：
原理：事件冒泡
优点：
	1.避免遍历集合（节省给各个元素绑定事件的时间）
	2.可以为新添加的元素注册事件

 */


</script>
</body>
</html>